package com.fuershiye.woman.monitor.service;

import java.util.List;
import java.util.Set;

import com.fuershiye.woman.monitor.beans.IdName;
import com.fuershiye.woman.monitor.beans.Page;
import com.fuershiye.woman.monitor.model.FormsDepart;

/**
 * @author yongyongdong
 *
 */
public interface FormsDepartService {

	public void save(FormsDepart it);

	public void delete(Long id);

	public FormsDepart get(Long id);

//	/**
//	 * 取当前表中最大数据
//	 *
//	 * @return
//	 */
//	public FormsDepart getTop();

//	/**
//	 * @param sort
//	 *            (当前位置)
//	 * @param aim
//	 *            方向 (1:比id大的; 2:比id小的)
//	 * @param count
//	 *            取几条数据
//	 * @return
//	 */
//	public FormsDepart findBySort(Long sort, Integer aim, Integer count);

//    /**
//     * 根据部门id 获取所有的指标id和名称
//     *
//     * @param depart 部门id
//     * @param year 年份
//     * @param forms 报表id
//     *
//     * @return	所有的指标id和名称
//     */
//    public List<IdName> getIdNameByDepart(Long depart, Integer year, Long forms);
    
    /**
     * 查找可用的status =1的
     * 同一个部门，同一年只能有一个可用的
     * 
     * @param departid 部门id
     * @param year 年份
     * @param year 报表id
     * 
     * @return
     */
    public FormsDepart findExist(Long departid, Long formsid, Integer year);
    
    /**
     * @param depart 部门id
     * @param year 年份
     * @param forms 报表id
     * 
     * @return
     */
    public FormsDepart findByDepartYearForms(Long depart, Integer year, Long forms);
    
	/**
	 * 
	 * @return
	 */
//	public List<FormsDepart> listByCondtion(Long formid, Long areaid, Integer year, Integer status, Page page);
//    public List<FormsDepart> listByCondtion(List<Long> departids, Integer year, Long forms, Integer status, Page page);
	public List<FormsDepart> listByCondtion(List<Long> departids, List<Integer> year, Long forms, Integer status, Page page);

	public List<FormsDepart> listByCondtionStatusOpposite(List<Long> departid, List<Integer> years, Long formsid, Integer status, Page page);
	public List<FormsDepart> listByCondtionStatusOppositeAreaid(Long areaid, List<Integer> years, Long formsid, Integer status, Page page);
	public List<FormsDepart> listInCondtionStatusOpposite(List<Long> departids, List<Integer> years, Long formsid, Integer status, Page page);

//	public int countByCondtion(Long areaid, Long departid, Long formid, Integer year, Integer status);
    public int countByCondtion(List<Long> departids, Integer year, Long forms);
//	public int countByCondtionStatusOpposite(Long departid, List<Integer> years, Long formsid, Integer status);
	public int countByCondtionStatusOppositeAreaid(Long areaid, Long formsid, Integer year, Integer status);
    
    public List<Integer> getYears(List<FormsDepart> formsDepartList);
    
}
